<template>
	<view>
	
			<view class="flag">
				
			
				<u-dropdown>
					<u-dropdown-item v-model="value1" :title="label1" :options="options1" @change="change1"></u-dropdown-item>
					<u-dropdown-item v-model="value2" :title="label2" :options="options2" @change="change2"></u-dropdown-item>
				</u-dropdown>
			</view>
				
	
		
		<view class="goods_list">
			<view class="goods_item" v-for="item in goods" :key="item.id" @click="navItemCick(item.id)">
				<view class="price">
					<text>填报日期：{{item.date}}</text>
					<text>国别/地区：{{item.region}}</text>
					<text>商品：{{item.commodity}}</text>
					<text>金额(万美元)：{{item.money}}</text>
					<text>审核状态：{{item.state}}</text>
				</view>

				<view class="divLine"></view>
			</view>


			<view class="isOver" v-if="flag">-----没数据了</view>
		</view>
		
		 <view class='placeholder-view'></view>
		<view class='btn-view'>
			<view class="xz">
				<u-button size="medium" @click="navItem()">新增</u-button>
			</view>
		
			
<!-- 							<u-field @click="region_show" v-model="region_value"
									:disabled="true"  :placeholder="region"
									right-icon="arrow-down-fill"
									>
									</u-field>
									<u-action-sheet @click="confirm_region" :list="region_list" v-model="regionIsshow"></u-action-sheet> -->
			<!-- <view>
				<picker @change="bindPickerChange" :range="array">	
						<label>国籍：</label>
						<label class="">{{array[index]}}</label>		
					</picker>
			</view> -->
			</u-row>
		</view>
	</view>

</template>

<script>
	export default {

		components: {

		},

		data() {
			return {
				page: 1,
				goods: [],
				flag: false,
				array:[
					'1','2'
				],
				selectStateIsshow:false,
				selectState:'11',
				selectState_list:[
					{
						value: '1',
						label: '江'
					},
					{
						value: '2',
						label: '湖'
					}
				],
				label1: '请选择',
				label2: '请选择',
				value1:'',
				value2:'',
				options1: [{
						label: '全部',
						value: 0,
					},
					{
						label: '待审核',
						value: 1,
					},
					{
						label: '通过',
						value: 2,
					},
					{
						label: '未通过',
						value: 3,
					}
				],
				options2: [{
						label: '全部',
						value: 0,
					},
					{
						label: '1-1',
						value: 1,
					},
					{
						label: '1-2',
						value: 2,
					},
					{
						label: '1-3',
						value: 3,
					},
					{
						label: '1-4',
						value: 4,
					},
				],
			}
		},
		onLoad() {
			this.getGoodsList()
		},
		methods: {
			async getGoodsList() {
				// const res=	await this.$myRequest({
				// 		url:'coupon/dtarticle/list?page='+this.page+'&limit=10'
				// 	})
				// 	        //= this.goods 之前的数据
				// 			//res.data.page.list 请求的数据
				// 	this.goods = [...this.goods,...res.data.page.list]
				// 	this.goods = res.data.page.list;
				// 	console.log(res)
				this.goods = []
			
			
			},
			navItemCick(id){
				uni.navigateTo({
					url: '/pages/editDeal/editDeal?id='+id
				})
			},
			navItem() {
				uni.navigateTo({
					url: '/pages/addDeal/addDeal'
				})
			},
			change1(){
				let val = this.value1 
				this.label2 = '请选择'
				this.label1 = this.options1[val].label
				if(val == 0){
					this.goods = [{
						date: "2020-1-1",
						region: '上海',
						commodity: '纺织',
						money:'1111',
						state:'审核通过',
						id:1
					},
					{
						date: "2020-1-2",
						region: '上海',
						commodity: '纺织',
						money:'222',
						state:'审核中',
						id:1
					},
					{
						date: "2020-1-3",
						region: '上海',
						commodity: '纺织',
						money:'333',
						state:'审核中',
						id:1
					},
					{
						date: "2020-1-4",
						region: '上海',
						commodity: '纺织',
						money:'4444',
						state:'审核中',
						id:1
					},
					{
						date: "2020-1-5",
						region: '上海',
						commodity: '纺织',
						money:'5555',
						state:'审核中',
						id:1
					},
					{
						date: "2020-1-6",
						region: '上海',
						commodity: '纺织',
						money:'666',
						state:'审核中'
					},
					{
						date: "2020-1-7",
						region: '上海',
						commodity: '纺织',
						money:'1111',
						state:'审核中'
					},
					{
						date: "2020-1-8",
						region: '上海',
						commodity: '纺织',
						money:'777',
						state:'审核中'
					},
					{
						date: "2020-1-9",
						region: '上海',
						commodity: '纺织',
						money:'8888',
						state:'审核中'
					},
					{
						date: "2020-1-10",
						region: '上海',
						commodity: '纺织',
						money:'999',
						state:'审核中'
					},
					{
						date: "2020-1-11",
						region: '上海',
						commodity: '纺织',
						money:'1000',
						state:'审核中'
					},
					{
						date: "2020-1-12",
						region: '上海',
						commodity: '纺织',
						money:'12341',
						state:'审核中'
					}]
				}else if(val ==1){
					this.goods = [
						{
							date: "2020-1-2",
							region: '上海',
							commodity: '纺织',
							money:'222',
							state:'审核中',
							id:1
						},
						{
							date: "2020-1-3",
							region: '上海',
							commodity: '纺织',
							money:'333',
							state:'审核中',
							id:1
						},
						{
							date: "2020-1-4",
							region: '上海',
							commodity: '纺织',
							money:'4444',
							state:'审核中',
							id:1
						},
						{
							date: "2020-1-5",
							region: '上海',
							commodity: '纺织',
							money:'5555',
							state:'审核中',
							id:1
						},
						{
							date: "2020-1-6",
							region: '上海',
							commodity: '纺织',
							money:'666',
							state:'审核中'
						},
						{
							date: "2020-1-7",
							region: '上海',
							commodity: '纺织',
							money:'1111',
							state:'审核中'
						},
						{
							date: "2020-1-8",
							region: '上海',
							commodity: '纺织',
							money:'777',
							state:'审核中'
						},
						{
							date: "2020-1-9",
							region: '上海',
							commodity: '纺织',
							money:'8888',
							state:'审核中'
						},
						{
							date: "2020-1-10",
							region: '上海',
							commodity: '纺织',
							money:'999',
							state:'审核中'
						},
						{
							date: "2020-1-11",
							region: '上海',
							commodity: '纺织',
							money:'1000',
							state:'审核中'
						},
						{
							date: "2020-1-12",
							region: '上海',
							commodity: '纺织',
							money:'12341',
							state:'审核中'
						}
					]
				}else if(val ==2){
					this.goods = [
						{
							date: "2020-1-1",
							region: '上海',
							commodity: '纺织',
							money:'1111',
							state:'审核通过',
							id:1
						}
					]
				}else if(val ==3){
					this.goods = [
						
					]
				}
			},
			change2(){
				let val = this.value2
				this.label1 = '请选择'
				this.label2 = this.options2[val].label
				if(val ==0){
					this.goods =  [{
						date: "2020-1-1",
						region: '上海',
						commodity: '纺织',
						money:'1111',
						state:'审核通过',
						id:1
					},
					{
						date: "2020-1-2",
						region: '上海',
						commodity: '纺织',
						money:'222',
						state:'审核中',
						id:1
					},
					{
						date: "2020-1-3",
						region: '上海',
						commodity: '纺织',
						money:'333',
						state:'审核中',
						id:1
					},
					{
						date: "2020-1-4",
						region: '上海',
						commodity: '纺织',
						money:'4444',
						state:'审核中',
						id:1
					},
					{
						date: "2020-1-5",
						region: '上海',
						commodity: '纺织',
						money:'5555',
						state:'审核中',
						id:1
					},
					{
						date: "2020-1-6",
						region: '上海',
						commodity: '纺织',
						money:'666',
						state:'审核中'
					},
					{
						date: "2020-1-7",
						region: '上海',
						commodity: '纺织',
						money:'1111',
						state:'审核中'
					},
					{
						date: "2020-1-8",
						region: '上海',
						commodity: '纺织',
						money:'777',
						state:'审核中'
					},
					{
						date: "2020-1-9",
						region: '上海',
						commodity: '纺织',
						money:'8888',
						state:'审核中'
					},
					{
						date: "2020-1-10",
						region: '上海',
						commodity: '纺织',
						money:'999',
						state:'审核中'
					},
					{
						date: "2020-1-11",
						region: '上海',
						commodity: '纺织',
						money:'1000',
						state:'审核中'
					},
					{
						date: "2020-1-12",
						region: '上海',
						commodity: '纺织',
						money:'12341',
						state:'审核中'
					}]
				}else if(val ==1){
					this.goods =  [{
						date: "2020-1-1",
						region: '上海',
						commodity: '纺织',
						money:'1111',
						state:'审核通过',
						id:1
					}]
				}else if(val ==2){
					this.goods = [
						{
							date: "2020-1-2",
							region: '上海',
							commodity: '纺织',
							money:'222',
							state:'审核中',
							id:1
						},
						
					]
				}else if(val ==3){
					this.goods = [
						{
							date: "2020-1-3",
							region: '上海',
							commodity: '纺织',
							money:'333',
							state:'审核中',
							id:1
						},
						
					]
				}else if(val ==4){
					this.goods = [
						{
							date: "2020-1-4",
							region: '上海',
							commodity: '纺织',
							money:'4444',
							state:'审核中',
							id:1
						},
						
					]
				}
			}

		},
		onReachBottom() {
			if (this.goods.length < this.page * 10) return this.flag = true
			this.page++
			this.getGoodsList()
		},
		
	}
</script>

<style lang="scss">
	.goods_list {
		background: #eee;
	}

	.isOver {
		width: 100%;
		height: 50px;
		line-height: 50px;
		text-align: center;
		font-size: 28rpx;
	}

	.price {
		font-size: 36rpx;
		margin: 20rpx 0 5rpx 0;
		display: flex;
		padding: 0 15rpx;
		flex-wrap: wrap;
		justify-content: space-between;
	}

	.divLine {
		height: 10rpx;
		justify-content: space-between;
		background: #FFFFFF;
		width: 100%;

	}
	.placeholder-view {
	  width: 100%;
	  height: 150rpx;
	}
.btn-view {
  width: 100%;
  padding: 20rpx 0;
  position: fixed;
  bottom: 0;
  left: 0;
}

.btn {
  width: 90%;
}
.wrap {
		padding: 24rpx;
	}

	.u-row {
		margin: 40rpx 0;
	}

	.demo-layout {
		height: 80rpx;
		border-radius: 8rpx;
	}

	.bg-purple {
		background: #d3dce6;
	}

	.bg-purple-light {
		background: #e5e9f2;
	}

	.bg-purple-dark {
		background: #99a9bf;
	}
	
	.flag{
		   display: block;
		  

		   
	
	}
	
	.xz{
		float: right;
	}
</style>
